package com.iqik.base.hash;

import java.util.Random;

public class RandomCode {

    private static String[] numbers = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"};

    private static String getCode() {
        StringBuilder buf = null;
        Random random = new Random();
        int a = 0;
        while (a == 0) {
            a = random.nextInt(10);
        }
        buf = new StringBuilder(numbers[a]);
        for (int i = 0; i < 5; i++) {
            a = random.nextInt(10);
            buf.append(numbers[a]);
        }
        return buf.toString();
    }

    public static void main(String[] args) {
        for (int i = 0; i < 30; i++) {
            System.out.println(getCode());
        }
    }
}
